package com.example.demo.dao;

import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * Mybatis 注解式开发
 * @Mapper mybatis框架  标记mybatis映射器
 * springbootApplication  @MapperScan  二选一  (此处标记@Mapper  即可)
 * @Repository  spring注解，标记为bean
 */

@Mapper
@Repository
public interface AdminDAO {

    @Select("select * from tb_user where user_name=#{user.user_name} and password = #{user.password}")
     User queryUser(@Param("user") User user);
}
